home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
ctutor.exe
/
SOURCE
/
POINTER.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-15
|
620b
|
24 lines
/* Chapter 8 - Program 1 - POINTER.C */
#include "stdio.h"
void main() /* illustration of pointer use */
{
int index, *pt1, *pt2;
index = 39; /* any numerical value */
pt1 = &index; /* the address of index */
pt2 = pt1;
printf("The value is %d %d %d\n", index, *pt1, *pt2);
*pt1 = 13; /* this changes the value of index */
printf("The value is %d %d %d\n", index, *pt1, *pt2);
}
/* Result of execution
The value is 39 39 39
The value is 13 13 13
*/